#ifndef _timebase_h_
#define _timebase_h_

#ifdef _TIMEBASE_C_
  #define _EXT_
#else
  #define _EXT_ extern
#endif

_EXT_ volatile t_time systemTime;
_EXT_ volatile t_date systemDate;

_EXT_ uchar volatile second;

_EXT_ void timer_background(void);
_EXT_ void init_timer( void );
_EXT_ void timer_freeze(t_time *local);
_EXT_ unsigned int timer_freeze_ticks(void);
_EXT_ unsigned char timer_timeover(t_time *local, unsigned long seconds);
_EXT_ unsigned char timer_timeover_ticks(unsigned int uiTicks, unsigned int uiDelay);
_EXT_ unsigned char timer_checkAlarm(t_time *local);
_EXT_ void timer_setTimer(t_time *local, unsigned long seconds);
_EXT_ unsigned char dateModify(t_date *date, unsigned char type, signed char modifier);
_EXT_ unsigned char timeAdd(t_time *time, t_time *timeAdd);

#undef _EXT_
#endif
